package ms;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class Receiver {
    public static void main(String[] args) throws Exception {
        Socket socket = null;
        ServerSocket serverSocket = new ServerSocket(5000);  //监听5000端口
        socket = serverSocket.accept();

        BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));

        String message = null;
        while ((message = in.readLine()) != null) {
            System.out.println(message);
        }
    }
}
